using System;
using System.Collections.Generic;
using System.Text;

namespace Jeffrey.XFramework.XManager
{
    public abstract class UriContainer
    {
        private static readonly Object s_SyncRoot = new Object();

        internal protected String GetNext()
        {
            lock(s_SyncRoot)
                return innerGetNext();
        }

        internal protected void Schedule(String url)
        {
            lock (s_SyncRoot)
                innerSchedule(url);
        }

        internal protected virtual Boolean Initialize()
        {
            //by default just return...
            return true;
        }

        internal protected abstract void Release();

        public abstract Int32 UriCounter { get; }

        protected abstract String innerGetNext();

        protected abstract void innerSchedule(String uri);
    }
}
